import { useEventSource } from "@vueuse/core"

export function useSource(url: string, options: any) {
    const baseURL = import.meta.env.VITE_APP_API_BASE_URL
    const headers = {
        "Content-Type": "application/json",
    }
    options.headers = {
        ...headers,
        ...options.headers,
    };
    return useEventSource(baseURL + url, options);
}